UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'S4lotd7vPpdNWP7bsYWW0s1JLvp1csyPLGICmOtuZks='
WHERE
key_id = '32d3d9c466bf771cfa6e0e70fc4c235a8ec594fa87c99fde65fd0785445e0483'
AND (
token = 'S4lotd7vPpdNWP7bsYWW0s1JLvp1csyPLGICmOtuZks='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)