UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6Qn7DSwcH5bqD8e7nw+/1YK23I0TgpJii/T7HpBLcMA='
WHERE
key_id = 'c0d026c50308be3d3b5fabd9f2205b945f2e73c101d1c2b99ac6232e0827eb02'
AND (
token = '6Qn7DSwcH5bqD8e7nw+/1YK23I0TgpJii/T7HpBLcMA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)