UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5HefVKU9plPtG8rLvWY8bvpBx9xWv19qyRi+c6sIAHM='
WHERE
key_id = '8986dbf19a729c273fd6f91ae7cdc31b3b9e0e2b0d6ad75c66285bbbdd3a3ba1'
AND (
token = '5HefVKU9plPtG8rLvWY8bvpBx9xWv19qyRi+c6sIAHM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)