UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ytAM3ww6i60ViNN8wcTvsQji1RWmPnBhi3z1sOo1pZo='
WHERE
key_id = '8e08cca936543d7400ccf587cce8f42b4608647fb8f8b3cc7dc2327ae238eee6'
AND (
token = 'ytAM3ww6i60ViNN8wcTvsQji1RWmPnBhi3z1sOo1pZo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)