UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hkqROiuxl98VVJlEJiAJW/Ckvq8q4EXoejNNG8Z1sZo=' 
WHERE 
  key_id = '3aac4e7d3cacceaa4532e87abeef190828030f246ff84687d57f247c7c26dd06' 
  AND (
    token = 'hkqROiuxl98VVJlEJiAJW/Ckvq8q4EXoejNNG8Z1sZo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020