UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'u1GkXRXMMedELzTwO2ocD8Dc21a/zi0S2e6HXsfnr4M='
WHERE
key_id = 'd24e1fa34e9e9fd8c9b03a486749f0b2bce0a025bc14fa94423b72559d6ec82c'
AND (
token = 'u1GkXRXMMedELzTwO2ocD8Dc21a/zi0S2e6HXsfnr4M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)