UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'XdF7gGpiEaPljJiEhdKBlQaxtkPglBnwPgQRPRVWEts=' 
WHERE 
  key_id = '0fb183f3b27ab4444f2621ccbdc6972064aa1d48063ac28fbcf9098c1049aa1d' 
  AND (
    token = 'XdF7gGpiEaPljJiEhdKBlQaxtkPglBnwPgQRPRVWEts=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00079