UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vVZ21ER7Nq2CgCghJIR98mNjShSxeMRl0aa1KNspjoo='
WHERE
key_id = '52cdf7e9cc44972a09007687a35654d1f9c4276e62666c1644d8f52dc6da58c2'
AND (
token = 'vVZ21ER7Nq2CgCghJIR98mNjShSxeMRl0aa1KNspjoo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)