UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fMsgPsHnbSGFnjGJEnV5n7mQQtO9K4ndNBLkV+EKZZo='
WHERE
key_id = '8117ad821a3b6a8b1390ac9e92d09e73a999f69b2f1ffc0fdedbf01f409333bd'
AND (
token = 'fMsgPsHnbSGFnjGJEnV5n7mQQtO9K4ndNBLkV+EKZZo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)