UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'eqIgq68Yz7fiNF10KE0aaKdsAa2WF48+sbo8SMxLWk4='
WHERE
key_id = '4cb602531df5d68e68c84848d2c0bb926e4f4b208bf585df1e2ed04b94575eff'
AND (
token = 'eqIgq68Yz7fiNF10KE0aaKdsAa2WF48+sbo8SMxLWk4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)