UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/iU9I8u0KmJMbfiAhmYBGTPOzyfnsy7ZAMGsLRAVPVE=' 
WHERE 
  key_id = '020d77a09b92f4ccab0ccd18857f534c3c66809511abb423114f1a6c68b4ea5b' 
  AND (
    token = '/iU9I8u0KmJMbfiAhmYBGTPOzyfnsy7ZAMGsLRAVPVE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029