UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'M64Os4xt+djJCa96OA76CkjuCjKOFpX2kA8ieaycYkk='
WHERE
key_id = '6a9d0f098efede9fa22cb7f7396ba723b8b26675476ef47cb0ba97226b01cd72'
AND (
token = 'M64Os4xt+djJCa96OA76CkjuCjKOFpX2kA8ieaycYkk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)