UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lABk0M+IeIYl0x+Kig0abbFxtavugBMlba2StFmeM5g=' 
WHERE 
  key_id = '1c7c11610b0845c0b3699aba00eb6c91c19cd8c2b6b9ca32c1f5f85dc3f30176' 
  AND (
    token = 'lABk0M+IeIYl0x+Kig0abbFxtavugBMlba2StFmeM5g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00071