UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/AqkW5dRgxN4t+W8TP2j8IiouFpn4vXPpkP9k+vhPrI='
WHERE
key_id = '0ef25b74bd635ded53c806c7d3c3d949491849dcaca618b3728a02c4a9cc2715'
AND (
token = '/AqkW5dRgxN4t+W8TP2j8IiouFpn4vXPpkP9k+vhPrI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)