UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+Ramx9XFU0XrGnGqwlfYN51Y2gSxzAjeLutFpUfgDeE='
WHERE
key_id = '83c78e54722bdbd809d7143bba4f3ce6d6ba064deef3d2f29543cae61ebd973d'
AND (
token = '+Ramx9XFU0XrGnGqwlfYN51Y2gSxzAjeLutFpUfgDeE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)