UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VqsDZsMrFyj9yRlkj3oHjdxKmbS8yFjo4p3bhtUu9JQ='
WHERE
key_id = '8a5435f9cbb3a99eda1a6931d8d3ef35c9acd0fefb88a029c17b5619775dd818'
AND (
token = 'VqsDZsMrFyj9yRlkj3oHjdxKmbS8yFjo4p3bhtUu9JQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)