UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DImc8GIBgaPcSy9XkIEKovIj7JxCPsJ+b7XrJcoAfk4=' 
WHERE 
  key_id = '69f211f7ed099474bfff244114b142f4019a3161479317751894ba89144329da' 
  AND (
    token = 'DImc8GIBgaPcSy9XkIEKovIj7JxCPsJ+b7XrJcoAfk4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022