UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WoM9SqVw8bmJHy/dvkC62zhGI2HI66ulfqSFh4yfJog=' 
WHERE 
  key_id = 'ef318798062c9e1612964e2b89f5cf0067e0039b3d98f51075fa9fc8967cd4df' 
  AND (
    token = 'WoM9SqVw8bmJHy/dvkC62zhGI2HI66ulfqSFh4yfJog=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039