UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'BwKdRp/vjl42yQFxzcCNSI2HjGosD5XLWj+LowP2Mfg='
WHERE
key_id = 'c1f5a300deee5bfad8a1fa46f7b7607b3f6707a941a3a642e3f80ac000cb72ed'
AND (
token = 'BwKdRp/vjl42yQFxzcCNSI2HjGosD5XLWj+LowP2Mfg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)