UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'h1w0jTRHXmylv7ehbRpngC3/WOMxd1ATcMB1mcgP1QA=' 
WHERE 
  key_id = '005b6c716be1a65a7b2dbff6f0b6cb8934e6d9210e9f9c9d59a8f416f0366836' 
  AND (
    token = 'h1w0jTRHXmylv7ehbRpngC3/WOMxd1ATcMB1mcgP1QA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020