UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'cahAFHvD9VTqrCMKopNT8hOMbS6lC1U5mza6/uXpxPc=' 
WHERE 
  key_id = '8c634e6b632aebf3ec52a1b5b7980123bf63d8ce66d9157cf519c64f13be2ae8' 
  AND (
    token = 'cahAFHvD9VTqrCMKopNT8hOMbS6lC1U5mza6/uXpxPc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024