UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'pkvl8XQKnMUdE/JK3GqygJZ7o9MhJpv+KmF24c2CdPc=' 
WHERE 
  key_id = 'ecbc7a89a57668a878046460719cbfc8c4c4ecedfc6d41bff98be3a6c7c831cd' 
  AND (
    token = 'pkvl8XQKnMUdE/JK3GqygJZ7o9MhJpv+KmF24c2CdPc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046