UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VQeFvdt2a+hzTgzZE819krAUoCnL8S6DJqChcn4qbUY=' 
WHERE 
  key_id = 'b63c4088a01fcbb900d03ca60fa234138041ebf387f7f74cc7fb63816873a43f' 
  AND (
    token = 'VQeFvdt2a+hzTgzZE819krAUoCnL8S6DJqChcn4qbUY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023