UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9SbCL5UFy2j/02CkW+JSjcQNW4ZYKRjM0QV6G58wUQY=' 
WHERE 
  key_id = '643aec5105e9441cce179fa73d5a8befbc446b944d895e770d3a7e68c9e29279' 
  AND (
    token = '9SbCL5UFy2j/02CkW+JSjcQNW4ZYKRjM0QV6G58wUQY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033