UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'o+s/KqzG8BmaVBiwCLXJaLZzxeEJq6gzQqlJJpm4uM0=' 
WHERE 
  key_id = '91781ebf238236471a8b96bbeeee4010eb378bfb6f4df85c18623274c0967e6d' 
  AND (
    token = 'o+s/KqzG8BmaVBiwCLXJaLZzxeEJq6gzQqlJJpm4uM0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045