UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HVhsR1XzbAyhegf/ILpaLeyuHXRbb5rJ2uDEk9lqt58='
WHERE
key_id = 'da0444decc9f750bbc05b1109ab73a3829bae903620672e2b90b4a9694a3c153'
AND (
token = 'HVhsR1XzbAyhegf/ILpaLeyuHXRbb5rJ2uDEk9lqt58='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)