UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rdO+4SopUyzXrcCUFzE3OLi2wMg+iKLq0rWXkfaZrYo='
WHERE
key_id = '5d95cc81a25d995fbc386bb455cd637bdcdc99177bb70c63f7519074090eb8f9'
AND (
token = 'rdO+4SopUyzXrcCUFzE3OLi2wMg+iKLq0rWXkfaZrYo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)