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