UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/cd35SD18Yz8xrSoZ/dLWcQR7ATMYR2fwEHnG7qLXME='
WHERE
key_id = 'aa649da543489353883abb05d6698260a68788360abfc4bee65d013fbb324cf0'
AND (
token = '/cd35SD18Yz8xrSoZ/dLWcQR7ATMYR2fwEHnG7qLXME='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)