UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yqMoNHGgrGfoC+fkDPUWSYZzFefmahVMPkoUXPS40Sc='
WHERE
key_id = '15746318254fae888c7ed24fc15674d1cfa836fc855a58763719144500c169e7'
AND (
token = 'yqMoNHGgrGfoC+fkDPUWSYZzFefmahVMPkoUXPS40Sc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)