UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9+HL0Wj0E2igtMe4IQRTCPMMDchktYIRjeWYtpJxISQ='
WHERE
key_id = 'b03214318b9816276337d1c9b94ddf969334da65cad710605817b245d9dc5b5d'
AND (
token = '9+HL0Wj0E2igtMe4IQRTCPMMDchktYIRjeWYtpJxISQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)