UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DnDCplAtY0vKy6IRFz/HMsHu3egbaK92D/OHEuoD+bA=' 
WHERE 
  key_id = '139555b35dd0e50f853ec37e4668fd7625c45edf73a4389214b98a5975d00be6' 
  AND (
    token = 'DnDCplAtY0vKy6IRFz/HMsHu3egbaK92D/OHEuoD+bA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019