UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2og87+QNWe1ZaO12ZNav86lo3QJUpLvDWt/14+oXl4o='
WHERE
key_id = '8c9f271d1284de7f56196f8fc60c1187286a0aa820a4fd1a487f99cd9a9f0624'
AND (
token = '2og87+QNWe1ZaO12ZNav86lo3QJUpLvDWt/14+oXl4o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)