UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'KNgF/ra+P2AdB4fpLfFUtNLE9a8MfTP+FqtSOWiTo5w=' 
WHERE 
  key_id = 'f3b55d4166b6d2efb7a9c5b69d5da8a68c7299b9c2e72ab0cc8b1514ea7c7a4f' 
  AND (
    token = 'KNgF/ra+P2AdB4fpLfFUtNLE9a8MfTP+FqtSOWiTo5w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028