UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qDtkc3SwKvlUjC2lrTkC2wo9NSvPbkjkQ3qTV9KiH1c='
WHERE
key_id = 'f70273c89cceaf69232004f6b93d775f86bbd2264d1615f5a0175a4969aad0bb'
AND (
token = 'qDtkc3SwKvlUjC2lrTkC2wo9NSvPbkjkQ3qTV9KiH1c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)