UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2BeXjbFK43220Alm5hXxGiXlL5Lmk8sDFZDIhgzhkbM='
WHERE
key_id = 'cca1d662b89606c4b06e04798bad0e0516696d8311ffb7cec73f14152de1f9a2'
AND (
token = '2BeXjbFK43220Alm5hXxGiXlL5Lmk8sDFZDIhgzhkbM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)