UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kgstUDFFrEO6q73JqlCIgRjQRmrwztb8kJ61Gw4U1nI=' 
WHERE 
  key_id = '4def6909ea7a73b4bed9f2391e24f44b0eaba2d003516ded8d95582d6c3a26e4' 
  AND (
    token = 'kgstUDFFrEO6q73JqlCIgRjQRmrwztb8kJ61Gw4U1nI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00099