UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1llJRyjQ53S44YhdavB+Nry3EwijyoxMtpsLrJe/JTY='
WHERE
key_id = '52a7020c64a28a05fa87c7818f209742dcac63207d1ccd270e5a9cec51522daa'
AND (
token = '1llJRyjQ53S44YhdavB+Nry3EwijyoxMtpsLrJe/JTY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)