UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'STNXanv0vPNFbURM/iYEioAtH8fVCU076mCttmseSsM='
WHERE
key_id = '6406e3c625774ada1ca10e122c45d14a9a0d1b9a4e01fb9c461b2a9ae31ef4d1'
AND (
token = 'STNXanv0vPNFbURM/iYEioAtH8fVCU076mCttmseSsM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)