UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'u55aYrV4zZmW1vEQt8N4k8WnoGyN5XFMy4W76YfWHUM='
WHERE
key_id = '134e07a7ae6d8664884a3059ec24ee63cc6b05411d6d3c38b38bc63af0917036'
AND (
token = 'u55aYrV4zZmW1vEQt8N4k8WnoGyN5XFMy4W76YfWHUM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)