UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WgmRRIo9FNTAzQzGueQEMNM54fZJX0eD6DRUqdDNvP0=' 
WHERE 
  key_id = 'dcb5acddec6a81263eacb78d1fd5c5de7aa20d74def2d976684f4819c40fb78c' 
  AND (
    token = 'WgmRRIo9FNTAzQzGueQEMNM54fZJX0eD6DRUqdDNvP0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027