UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'beMGOH5AwBfrqcnOnfUqX/m3OBcEg9oZptT9eVL1RYE=' 
WHERE 
  key_id = '8500e08709569988cfc72479d538434b405c3795622be9ea4a620f7499bbdb26' 
  AND (
    token = 'beMGOH5AwBfrqcnOnfUqX/m3OBcEg9oZptT9eVL1RYE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030