UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'U/vNsWJNqun8xY5mAqbSzovFMianrxX3102fYwhG7Y0='
WHERE
key_id = 'f80c719c68d0b067596875443dbf18253f3e8e7fb274976b871863da86d2de49'
AND (
token = 'U/vNsWJNqun8xY5mAqbSzovFMianrxX3102fYwhG7Y0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)